<?php

$img_url = $_POST['img_url']; 
$sender  = $_POST['friend_name']; 
$toemail = $_POST['email'];
$subject = 'Triump - Merry Christmas & Happy New Year 2014'; 
$bgurl = get_bloginfo('template_url').'/img/mailbg.jpg';
$message = "
<div style='background: url({$bgurl}) no-repeat #fff; height: 800px; position: relative; width: 800px;' ><div style='padding-top: 56px; padding-left: 47px;'><img width='703' src='{$img_url}' /></div><div style='clear:both'></div><a style='padding-top: 31px; text-decoration: none; float: right; margin-right: 223px; margin-top: 121px; color: rgb(85, 85, 85);' href='https://www.facebook.com/Triumph.vn'>https://www.facebook.com/Triumph.vn</a></div>";
 
 
add_filter( 'wp_mail_content_type', 'set_html_content_type' );

wp_mail( $toemail, $subject , $message );

remove_filter( 'wp_mail_content_type', 'set_html_content_type' );

function set_html_content_type() {

	return 'text/html';
}

 die; 
 


